Spam-Proofing Your Website
By Dan Thies


Technique #2: Use A Contact Form

Sometimes, the sheer volume of legitimate email from real visitors can become a burden. In this case, a simple solution is to remove your email address from your site entirely, and use a contact form. There are dozens of free ASP, Perl, and PHP scripts available online that will allow your users to fill in a form, and send you an email. Most hosting providers now offer this service for free to their customers.

A contact form can enable you to deal with a higher volume of mail, by allowing you to pre-sort different types of message. This is easily accomplished by creating a drop-down menu with different options (e.g. customer service, billing, tech support, etc.) that will populate the subject line of the email message, and/or change the email address to which the form is sent.

Since many spambots simply read the entire HTML source of the page, looking for anything that looks like an email address, your contact form may not protect you, if you include your email address in the HTML for your contact form (for example, as a hidden field). You can use JavaScript, as in the example below, to mask the address, or if you have the skill, you can embed the email address in your form processing script, where nobody can find it.

Example 4: Masking The Email Address In A Form Field
Instead of simply listing your email address in a form field, use the snippet below to replace the form field that contains your email address.

<script language=javascript>
<!--
var username = "username";
var hostname = "yourdomain.com";
var linktext = username + "@" + hostname;
document.write("<input type=hidden name=email value=" +username
+ "@" + hostname" + ">";
document.write(username + "@" + hostname);
//-->
</script>


Thanks for reading...
I hope that this tutorial has given you a clear understanding of how to protect your website, and your email address, from spammers and spambots. If you have any questions about this article, feel free to contact me through my website. The (spam-proof) email link can be found at the bottom of my home page.


About The Author

Dan Thies has been helping his clients (and friends) promote their websites since 1996. His latest book, Search Engine Optimization Fast Start , offers a simple, step by step plan to increase your website's search engine traffic.